#include <stdio.h>

#include "tlib_ini.h"

main()
{
    int iIniHandle;
    char s[20];

    iIniHandle = TLib_Ini_Load("test.ini", TLIB_INI_OPEN_NORMAL);
    if (iIniHandle < 0)
    {
        printf("Fail To Load Ini\n");
        return -1;
    }


    TLib_Ini_Dump(iIniHandle);

    TLib_Ini_RemoveSection(iIniHandle, "FrontEndComm");

    TLib_Ini_WriteString(iIniHandle, "FrontEndComm", "CommPort", "1001");

    TLib_Ini_Save(iIniHandle, "save.ini");

    printf("-----------------\n");
    TLib_Ini_ReadString(iIniHandle, "FrontEndTCP", "ServicePort", "1001", s, sizeof(s));
    printf("FrontEndTCP>ServicePort>%s\n", s);

    TLib_Ini_Free(iIniHandle);

    return 0;
}